#ifndef DEFS_H
#define DEFS_H
#include <assert.h>

// added by xianxing
#define ROUND_TO_RANGE(a,min,max,size)   \
    do{ \
    assert(max - min == size);  \
    while(*a < min) *a += size; \
    while(*a > max) *a -= size; \
    }while(0)

#define COLOR_IN_RANGE(c)   \
    do{ \
    assert(c >= 0 && c <= 255);\
    }while(0)

#ifndef PI
#define PI 3.14159265359
#endif

//#ifndef e
//#define e 2.718281828459
//#endif

#endif // DEFS_H
